-- GENERATED SPELL FOR [Mad Servant] --


function spell0_15111(pUnit, Event) --@Fireball,n/a--
pUnit:FullCastSpellOnTarget(24611,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15111', 9500, 1)
end

function spell1_15111(pUnit, Event) --@Flamestrike,n/a--
pUnit:FullCastSpellOnTarget(24612,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_15111', 10000, 1)
end

function spell2_15111(pUnit, Event) --@Portal of Madness,Self--
pUnit:FullCastSpellOnTarget(24621,pUnit)
pUnit:RegisterEvent('Sorts_15111', 14319, 1)
end

function Sorts_15111(pUnit, Event)
local choix_sorts_15111 = math.random(0, 2)
if choix_sorts_15111 == 0 then
pUnit:RegisterEvent('spell0_15111', 1, 1)
end
if choix_sorts_15111 == 1 then
pUnit:RegisterEvent('spell1_15111', 1, 1)
end
if choix_sorts_15111 == 2 then
pUnit:RegisterEvent('spell2_15111', 1, 1)
end
end

function mob15111_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_15111', math.random(1500, 3000), 1)
end

function mob15111_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15111_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob15111_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(15111, 1, 'mob15111_Action')
RegisterUnitEvent(15111, 2, 'mob15111_Leave')
RegisterUnitEvent(15111, 3, 'mob15111_Kill')
RegisterUnitEvent(15111, 4, 'mob15111_Die')
